package com.tjhzzx.danfossNiagaraCore.enums;

import javax.baja.sys.BFrozenEnum;
import javax.baja.sys.Sys;
import javax.baja.sys.Type;

/**
 * @author Luc
 * @create 2019-11-14 22:13
 */
public final class BTreeMenuItemType extends BFrozenEnum {
    public static final int DASHBOARD = 0;
    public static final int PX_VIEW = 1;
    public static final int SEARCH_PARAMS = 2;
    public static final int PAGE = 3;
    public static final int IMAGE = 4;
    public static final int TEXT = 5;
    public static final int FILE = 6;
    public static final int URL = 7;
    public static final int TABLE = 8;

    public static final BTreeMenuItemType dashboard = new BTreeMenuItemType(0);
    public static final BTreeMenuItemType pxView = new BTreeMenuItemType(1);
    public static final BTreeMenuItemType searchParams = new BTreeMenuItemType(2);
    public static final BTreeMenuItemType page = new BTreeMenuItemType(3);
    public static final BTreeMenuItemType image = new BTreeMenuItemType(4);
    public static final BTreeMenuItemType text = new BTreeMenuItemType(5);
    public static final BTreeMenuItemType file = new BTreeMenuItemType(6);
    public static final BTreeMenuItemType url = new BTreeMenuItemType(7);
    public static final BTreeMenuItemType table = new BTreeMenuItemType(8);

    public static final BTreeMenuItemType DEFAULT = page;

    public BTreeMenuItemType(int ordinal) {
        super(ordinal);
    }

    public static BTreeMenuItemType make(int ordinal) {
        return (BTreeMenuItemType) page.getRange().get(ordinal, false);
    }

    public static BTreeMenuItemType make(String tag) {
        return (BTreeMenuItemType) page.getRange().get(tag);
    }

    public static String expose() {
        return "{\"DASHBOARD\":0, \"PX_VIEW\":1, \"SEARCH_PARAMS\":2, \"PAGE\":3, \"IMAGE\":4, \"TEXT\":5, \"FILE\":6, \"URL\":7, \"TABLE\":8}";
    }

    @Override
    public Type getType() {
        return TYPE;
    }
    public static final Type TYPE = Sys.loadType(BTreeMenuItemType.class);
}
